<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="板卡原材料批次号">
              <a-input placeholder="请输入板卡原材料批次号（原材料采购订单号）" v-model="queryParam.boardRawNo"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="16">
            <a-form-item label="输入值（电压或电流）">
              <a-input placeholder="请输入最小值" class="query-group-cust" v-model="queryParam.inputVal_begin"></a-input>
              <span class="query-group-split-cust"></span>
              <a-input placeholder="请输入最大值" class="query-group-cust" v-model="queryParam.inputVal_end"></a-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :md="12" :sm="16">
              <a-form-item label="输出最大值">
                <a-input placeholder="请输入最小值" class="query-group-cust" v-model="queryParam.outputMaxVal_begin"></a-input>
                <span class="query-group-split-cust"></span>
                <a-input placeholder="请输入最大值" class="query-group-cust" v-model="queryParam.outputMaxVal_end"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="16">
              <a-form-item label="输出最小值">
                <a-input placeholder="请输入最小值" class="query-group-cust" v-model="queryParam.outputMinVal_begin"></a-input>
                <span class="query-group-split-cust"></span>
                <a-input placeholder="请输入最大值" class="query-group-cust" v-model="queryParam.outputMinVal_end"></a-input>
              </a-form-item>
            </a-col>
          </template>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">

          <span slot="action" slot-scope="text, record">
          <template>
            <a @click="handleDetail(record)">详情</a>
          </template>
        </span>

      </a-table>
    </div>

    <zxjEip2cHgq-modal ref="modalForm" @ok="modalFormOk"></zxjEip2cHgq-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ZxjEip2cHgqModal from './modules/ZxjEip2cHgqModal'
  export default {
    name: "ZxjEip2cHgqList",
    mixins:[JeecgListMixin],
    components: {
      ZxjEip2cHgqModal
    },
    data () {
      return {
        description: 'zxj_eip_2c_hgq管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'板卡原材料批次号',
            align:"center",
            dataIndex: 'boardRawNo'
          },
          {
            title:'原材料类型',
            align:"center",
            dataIndex: 'rawMatType'
          },
          {
            title:'物料编码',
            align:"center",
            dataIndex: 'materialNo'
          },
          {
            title:'物料描述',
            align:"center",
            dataIndex: 'materialDesc'
          },
          {
            title:'检验日期',
            align:"center",
            dataIndex: 'checkTime'
          },
          {
            title:'序号',
            align:"center",
            dataIndex: 'serialNo'
          },
          {
            title:'输入值（电压或电流）',
            align:"center",
            dataIndex: 'inputVal'
          },
          {
            title:'输出最大值',
            align:"center",
            dataIndex: 'outputMaxVal'
          },
          {
            title:'输出最小值',
            align:"center",
            dataIndex: 'outputMinVal'
          },
          {
            title:'抓取状态',
            align:"center",
            dataIndex: 'ioflag',
            customRender:function (text) {
              return !text?"":(text == 0?'已抓取':'未抓取')
            }
          },
          {
            title:'抓取时间',
            align:"center",
            dataIndex: 'updateTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/apis/zxjEip2cHgq/list",
        },
        dictOptions:{
        }
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },
      handleDetail(record) {
        this.$refs.modalForm.addModal(record);
        this.$refs.modalForm.title = "互感器详细信息";
      }
       
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>